home *** CD-ROM | disk | FTP | other *** search
- /*
- BleuRoseErrors.h - This file defines the various data structures and
- function calls available in the Bleu Rose Ltd.
- Error Library
-
- Copyright 2000 Bleu Rose Ltd. All Rights Reserved.
-
- Author: Gary Rice
-
- Created: August 26, 2000 - Original development environment:
- CodeWarrior/Pro v5.3
- Mac OS v7.6.1
-
- Modified: N/A
-
- Licensing Notes:
- You may incorporate this source code into your
- applications without restriction.
-
- You are NOT permitted to redistribute the source,
- compiled binaries or the library that the code
- references without first licensing the package
- represented by this source file from Bleu Rose Ltd.
-
- Licensing information was packaged with the files
- that this file was part of. If that licensing information
- is no longer included in the files you have, you may obtain
- another copy by sending EMail to licensing@bleurose.com
- and asking for the Error Library Licensing Package.
-
- Usage Notes:
- This file is compatible with Universal Headers v3.2 and later.
-
- ******************************************************************
- PROLOGUE
- ******************************************************************/
- #ifndef __BleuRoseErrors__
- #define __BleuRoseErrors__
-
- #include <CodeFragments.h>
- #include <MixedMode.h>
- #include <ConditionalMacros.h>
-
- #ifdef __cplusplus
- extern "C" {
- #endif
- #if PRAGMA_IMPORT
- #pragma import on
- #endif
-
- #if PRAGMA_STRUCT_ALIGN
- #pragma options align=mac68k
- #elif PRAGMA_STRUCT_PACKPUSH
- #pragma pack(push, 2)
- #elif PRAGMA_STRUCT_PACK
- #pragma pack(2)
- #endif
-
- /******************************************************************
- TYPES & CONSTANTS
- ******************************************************************/
- #define kBleuRoseErrorLibVersion 0x0300 /* This is version 3 of the library */
- #define kBleuRoseErrorLibResType 'FAT ' /* Resource has both 68k & PPC code */
- #define kBleuRoseErrorLibCommonResID 29271 /* This value should not be changed */
- #define kBleuRoseErrorLibListType 'STR#' /* The error type list is this res kind */
- #define kBleuRoseErrorLibNoDescType 'STR ' /* The no description message is this res kind */
- #define kBleuRoseErrorLibDataType 'TEXT' /* The library is a TEXT resources */
- #define kEstimatedErrorResSize 256000 /* The TEXT resource is at least this big */
- #define kBleuRoseErrorLibFileName "\pBleuRoseErrorLib" /* The name of the file */
-
- typedef struct
- {
- SInt32 action; /* What information do you want? */
- SInt32 error; /* The error number to look up */
- SInt16 proposedErrorTypeNumber; /* The Error Type value to try */
- SInt16 actualErrorTypeNumber; /* The Error Type value matching the error found */
- Str255 errorTypeName; /* Name string of the Error Type number */
- Str255 pneumonic; /* Apple's name for this error */
- Str255 description; /* Apple's explanation of this error */
- } BleuRoseErrorLibStructure, *BleuRoseErrorLibStructurePtr;
-
- typedef long (*BleuRoseErrorLib)(BleuRoseErrorLibStructurePtr inOutData);
-
- enum
- {
- uppBleuRoseErrorLibProcInfo = kCStackBased
- | RESULT_SIZE (SIZE_CODE (sizeof(OSStatus)))
- | STACK_ROUTINE_PARAMETER (1, SIZE_CODE(sizeof(BleuRoseErrorLib*)))
- | STACK_ROUTINE_PARAMETER (2, SIZE_CODE(sizeof(BleuRoseErrorLibStructurePtr)))
- };
-
- enum /* Error types from STR# resource 29271 (listed alphabetically) */
- {
- k1stErrorTypeFound = 0,
- kAnsiCType = 175,
- kAppearanceManagerType = 1,
- kAppleCryptographicMessageSyntaxType = 137,
- kAppleDataStreamingProtocolType = 2,
- kAppleDVDPlayerType = 167,
- kAppleEventManagerType = 3,
- kAppleEventRegistryType = 4,
- kAppleFileSigningType = 136,
- kAppleGuideType = 6,
- kAppleOpenCollaborativeEnvironmentType = 142,
- kAppleScriptType = 7,
- kAppleSearchType = 101,
- kAppleSearchForWindowsType = 116,
- kAppleServerProtocolType = 8,
- kAppleScriptClientType = 9,
- kAppleShareClientType = 10,
- kAppleShareFileServerType = 145,
- kAppleShareRegistryType = 11,
- kAppleShareServerType = 126,
- kAppleSystemProfilerType = 113,
- kAppleTalkFilingProtocolType = 5,
- kAppleTalkManagerType = 102,
- kAppleTalkRemoteAccessType = 12,
- kAppleTalkRemoteAccessScriptingType = 141,
- kAppleTypeServicesType = 128,
- kAppleVisionType = 176,
- kAR2Type = 139,
- kAroseType = 143,
- kAvlTreeType = 181,
- kBleuRoseErrorLibType = 168,
- kCameraType = 14,
- kCarbonEventManagerType = 169,
- kCardAndSocketServicesType = 15,
- kClockType = 110,
- kCodeFragmentManagerType = 16,
- kCollectionManagerType = 18,
- kColorManagerType = 109,
- kColorPickerType = 19,
- kColorQuickdrawType = 120,
- kColorSyncManagerType = 20,
- kColorSyncScriptingType = 21,
- kCommunicationsToolboxType = 155,
- kComponentManagerType = 22,
- kCompressorDecompressorType = 17,
- kConnectionManagerType = 156,
- kControlManagerType = 23,
- kCoreFoundationType = 146,
- kDatabaseAccessType = 24,
- kDebuggingLibraryType = 151,
- kDeviceManagerType = 114,
- kDialogManagerType = 149,
- kDictionaryManagerType = 25,
- kDirectoryServicesType = 106,
- kDiskType = 111,
- kDisplayManagerType = 26,
- kDownloadManagerType = 131,
- kDragManagerType = 27,
- kDrawSprocketType = 28,
- kEditionManagerType = 29,
- kFileManagerType = 105,
- kFileTransferManagerType = 157,
- kFindByContentType = 30,
- kFinderType = 159,
- kFireWireType = 31,
- kFolderManagerType = 32,
- kFontManagerType = 117,
- kFontSyncType = 154,
- kGeneralSystemType = 33,
- kGeneralTextType = 34,
- kGeoPortType = 35,
- kGestaltType = 36,
- kHelpManagerType = 37,
- kHfsType = 119,
- kHfsExternalFileSystemType = 38,
- kHtmlRenderingType = 147,
- kHumanInterfaceDeviceType = 152,
- kHyperCardXcmdType = 179,
- kIconUtiltiesType = 39,
- kImovieType = 171,
- kInputSprocketType = 40,
- kInternationalDateAndTimeType = 124,
- kInternetConfigType = 160,
- kIoSystemType = 41,
- kIrDaType = 130,
- kJavaVirtualMachineManagerType = 42,
- kKeyChainManagerType = 43,
- kKernelType = 44,
- kLanguageAnalysisManagerType = 45,
- kLaserWriter8Type = 46,
- kLibraryManagerType = 47,
- kLinkToolManagerType = 134,
- kLocaleObjectManagerType = 48,
- kMacintoshManagerType = 172,
- kMacTextEditorType = 153,
- kMacTcpType = 49,
- kMemoryDispatchType = 50,
- kMemoryManagerType = 51,
- kMenuManagerType = 118,
- kMidiManagerType = 53,
- kMixedModeType = 54,
- kModemCclType = 140,
- kMultiprocessorType = 55,
- kNameBindingProtocolType = 56,
- kNameRegistryType = 57,
- kNavigationServicesType = 58,
- kNetBootType = 177,
- kNetSprocketType = 59,
- kNetShareManagerType = 138,
- kNetworkServicesLocationType = 125,
- kNetworkSetupType = 65,
- kNotificationManagerType = 60,
- kOffScreenQuickDrawType = 62,
- kOpenGlType = 123,
- kOpenScriptingArchitectureType = 63,
- kOpenTransportType = 64,
- kOpenDocType = 135,
- kOperatingSystemType = 164,
- kPackageManagerType = 133,
- kPaletteManagerType = 180,
- kPcAtAttachmentType = 13,
- kPcCardType = 66,
- kPlugInsManagerType = 132,
- kPowerMacDebuggerType = 174,
- kPowerManagerType = 68,
- kPrinterStatusType = 69,
- kPrintingType = 70,
- kPrintingManagerType = 178,
- kProcessManagerType = 71,
- kProcessToProcessCommunicationType = 67,
- kQuickdrawType = 162,
- kQuickdraw3dType = 72,
- kQuickdrawGxType = 73,
- kQuickdrawGxMessageManagerType = 52,
- kQuickdrawGxPrintingType = 74,
- kQuickTimeType = 75,
- kQuickTimeConferencingType = 76,
- kQuickTimeIcType = 77,
- kQuickTimeMusicType = 183,
- kQuickTimeStreamingType = 144,
- kQuickTimeVRType = 78,
- kQuickTimeForWindowsType = 79,
- kRendererAccelerationVirtualEngineType = 165,
- kResourceManagerType = 80,
- kScannerType = 81,
- kScrapManagerType = 82,
- kScsiManagerType = 83,
- kSerialDriverType = 108,
- kSerialPortType = 112,
- kSettingsOrLocationManagerType = 84,
- kSequenceGrabberType = 85,
- kSimpleMulticastRoutingProtocolType = 103,
- kSlotManagerType = 107,
- kSoundManagerType = 86,
- kSoundSprocketType = 87,
- kSpeechManagerType = 88,
- kSpeechRecognitionType = 89,
- kStartManagerType = 61,
- kStringCompareType = 90,
- kSysEnvironsType = 115,
- kSysErrsType = 161,
- kSystemLoggingServiceType = 106,
- kSystemNotificationServiceType = 104,
- kTelephoneManagerType = 91,
- kTerminalManagerType = 158,
- kTextEditType = 163,
- kTextEncodingConversionType = 92,
- kTextEnginesType = 93,
- kTextObjectsType = 94,
- kTextServicesManagerType = 95,
- kThreadManagerType = 96,
- kTranslationManagerType = 97,
- kUnclassifiedType = 100,
- kUnicodeUtilitiesType = 98,
- kUniversalSerialBusType = 99,
- kUrlAccessType = 127,
- kUsersAndGroupsType = 121,
- kUtcUtilitiesType = 150,
- kVideoDriverType = 184,
- kVirtualMemoryManagerType = 122,
- kVirtualUserType = 173,
- kWasteType = 182,
- kWindowManagerType = 148,
- kXmlParserType = 170,
- kXtndType = 129,
- kZlastType = 185 /* This is not a valid type. It is simply
- set to the highest number in the list + 1. */
- };
-
- enum
- { /* Warnings (positive values) - A warning should be treated as a conditionally successful status. */
- kWarningErrorNotDescribed = (long)2147483646L, /* 0x7FFFFFFE - The error has no description. */
- kWarningErrorNotDescribedAndNotRequestedType
- = (long)2147483645L, /* 0x7FFFFFFD - The error is not the type you requested
- and the error has no description. */
- kWarningLibraryNotLicensed = (long)2147483644L, /* 0x7FFFFFFC - This is an unlicensed library. The error
- description will be incorrect. */
- kWarningErrorNotRequestedType = (long)2147483643L, /* 0x7FFFFFFB - The error is not the type you requested. */
-
- /* Errors (negative values) - An error should be treated as a failure status. */
- kErrorNotOnFile = (long)-2147483648L, /* 0x80000000 - The error you requested is not in the database. */
- /* The following error values duplicate values already on file in the
- database. They were chosen anyway because they are the smallest possible values available. */
- kErrorTypeOutOfRange = (long)-2147483647L, /* 0x80000001 - The error type you requested is not valid. */
- kErrorTypeNotOnFile = (long)-2147483646L, /* 0x80000002 - The error type you requested is not in the database. */
- kErrorTypeResMissing = (long)-2147483645L, /* 0x80000003 - The error type STR# resource is missing. */
- kErrorResMissing = (long)-2147483644L, /* 0x80000004 - The error TEXT resource is missing. */
- kErrorNoDescResMissing = (long)-2147483643L /* 0x80000005 - The "no description" resource is missing. */
- }; /* Note that these error codes are themselves on file in the error database */
-
- enum /* Type of data to return from the database */
- {
- kGetError = -1L, /* Get the error information */
- kGetType = -2L /* Translate the error type to its name equivalent */
- };
-
- /******************************************************************
- FUNCTION PROTOTYPES
- ******************************************************************/
- EXTERN_API_C (OSStatus)
- FindBleuRoseErrorLibrary (FSSpecPtr theLibrary);
-
- EXTERN_API_C (OSStatus)
- CallBleuRoseErrorLibrary (FSSpecPtr theLibrary,
- BleuRoseErrorLibStructurePtr errorInfo);
-
- #if TARGET_RT_MAC_CFM
- typedef UniversalProcPtr BleuRoseErrorLibProcUPP;
- #define CallBleuRoseErrorLibProc(userRoutine, params) \
- CallUniversalProc((UniversalProcPtr)(userRoutine), uppBleuRoseErrorLibProcInfo, params)
- #define NewBleuRoseErrorLibProc(userRoutine) \
- (BleuRoseErrorLibProcUPP)NewRoutineDescriptor ((ProcPtr)(userRoutine), uppBleuRoseErrorLibProcInfo, GetCurrentISA())
- #define NewBleuRoseErrorLibProc68k(userRoutine) \
- (BleuRoseErrorLibProcUPP)NewRoutineDescriptor ((ProcPtr)(userRoutine), uppBleuRoseErrorLibProcInfo, (ISAType) kM68kISA)
- #else
- typedef BleuRoseErrorLib BleuRoseErrorLibProcUPP;
- #define CallBleuRoseErrorLibProc(userRoutine, params) \
- (*(userRoutine))(params)
- #define NewBleuRoseErrorLibProc(userRoutine) \
- (BleuRoseErrorLibProcUPP)(userRoutine)
- #define NewBleuRoseErrorLibProc68k(userRoutine) \
- (BleuRoseErrorLibProcUPP)(userRoutine)
- #endif
-
- /******************************************************************
- EPILOGUE
- ******************************************************************/
- #if PRAGMA_STRUCT_ALIGN
- #pragma options align=reset
- #elif PRAGMA_STRUCT_PACKPUSH
- #pragma pack(pop)
- #elif PRAGMA_STRUCT_PACK
- #pragma pack()
- #endif
-
- #ifdef PRAGMA_IMPORT_OFF
- #pragma import off
- #elif PRAGMA_IMPORT
- #pragma import reset
- #endif
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* __BleuRoseErrors__ */